<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue3加减计算器</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
    <div id="app">
       <button @click="increment">increment</button><br/>
        <input type="number" v-model="count"><br />
        <button @click="decrement">decrement</button>
    </div>
    <script>
        const obj = {
            data() {
                return {
                   count:0 
                }
            },
            methods: {
                 increment() {
                    this.count++
                },
                decrement() {
                    if (this.count > 1) {
                        this.count--
                    }
                },
            },
        };
       Vue.createApp(obj).mount('#app');
    </script>
</body>
</html>